
angular.module('mamApp').factory('ContractManagementManager', ['$http','api','paramsManager', function ($http,api,paramsManager) {
    var ContractManagementManager = {
        /**
         * 合约列表
         * @param params[pageNo,pageSize]
         * @returns result
         */
       contractManagementList: function (params,query) {
            return $http.get(api+'/admin/contracts/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 合约删除
         * @param params
         * @returns
         */

        contractDelete: function (id) {
            return $http.delete(api + '	/admin/contract/'+id.join(",")).then(function (result) {
                return result;
            });
        },
        /**
         * 合约添加
         * @param params[pageNo,pageSize]
         * @returns result
         */
        contractAdd: function (params) {
            return $http.post(api+'/admin/contract', params).then(function (result) {
                return result;
            });
        },   /**
         * 获取合约详情
         * @returns result
         */
        ContractEdit: function (id) {
            return $http.get(api+'/admin/contract/'+id).then(function (result) {
                return result;
            });
        },
        /**
         * 合约修改
         * @returns result
         */
        ContractModify: function (id,params) {
            return $http.put(api+'/admin/contract/'+id,params).then(function (result) {
                return result;
            });
        },

    };

    return ContractManagementManager;
}]);
